import tkinter as tk
from PIL import Image, ImageTk

# 断点的图标实现
class RedDot(tk.Label):
    # image = Image.open("./red_circle.png")
    # photo = ImageTk.PhotoImage(RedDot.photo)
    def __init__(self, master=None, **kwargs):
        # 打开图像
        self.image = Image.open("../images/red_circle.png")
        # 将图像转换为Tkinter可用的格式
        self.photo = ImageTk.PhotoImage(self.image)
        super().__init__(master, image=self.photo, width=20, height=20, **kwargs)


if __name__ == '__main__':
    win = tk.Tk()
    # image = Image.open("./red_circle.png")
    # 将图像转换为Tkinter可用的格式
    # photo = ImageTk.PhotoImage(image)
    dot = RedDot(win)
    dot.pack()
    win.mainloop()



